/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.admanager.acmeadmanagement.plugin.acmeadmanagement.impl;

import org.admanager.acmeadmanagement.plugin.acmeadmanagement.AcmeadmanagementPackage;
import org.admanager.acmeadmanagement.plugin.acmeadmanagement.PMultiplicity;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>PMultiplicity</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.admanager.acmeadmanagement.plugin.acmeadmanagement.impl.PMultiplicityImpl#getLowerBound <em>Lower Bound</em>}</li>
 *   <li>{@link org.admanager.acmeadmanagement.plugin.acmeadmanagement.impl.PMultiplicityImpl#getUpperBound <em>Upper Bound</em>}</li>
 *   <li>{@link org.admanager.acmeadmanagement.plugin.acmeadmanagement.impl.PMultiplicityImpl#isHorizontal <em>Horizontal</em>}</li>
 *   <li>{@link org.admanager.acmeadmanagement.plugin.acmeadmanagement.impl.PMultiplicityImpl#isVertical <em>Vertical</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PMultiplicityImpl extends EObjectImpl implements PMultiplicity {
	/**
	 * The default value of the '{@link #getLowerBound() <em>Lower Bound</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLowerBound()
	 * @generated
	 * @ordered
	 */
	protected static final int LOWER_BOUND_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getLowerBound() <em>Lower Bound</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLowerBound()
	 * @generated
	 * @ordered
	 */
	protected int lowerBound = LOWER_BOUND_EDEFAULT;

	/**
	 * The default value of the '{@link #getUpperBound() <em>Upper Bound</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUpperBound()
	 * @generated
	 * @ordered
	 */
	protected static final int UPPER_BOUND_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getUpperBound() <em>Upper Bound</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUpperBound()
	 * @generated
	 * @ordered
	 */
	protected int upperBound = UPPER_BOUND_EDEFAULT;

	/**
	 * The default value of the '{@link #isHorizontal() <em>Horizontal</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isHorizontal()
	 * @generated
	 * @ordered
	 */
	protected static final boolean HORIZONTAL_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isHorizontal() <em>Horizontal</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isHorizontal()
	 * @generated
	 * @ordered
	 */
	protected boolean horizontal = HORIZONTAL_EDEFAULT;

	/**
	 * The default value of the '{@link #isVertical() <em>Vertical</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isVertical()
	 * @generated
	 * @ordered
	 */
	protected static final boolean VERTICAL_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isVertical() <em>Vertical</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isVertical()
	 * @generated
	 * @ordered
	 */
	protected boolean vertical = VERTICAL_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected PMultiplicityImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return AcmeadmanagementPackage.Literals.PMULTIPLICITY;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getLowerBound() {
		return lowerBound;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLowerBound(int newLowerBound) {
		int oldLowerBound = lowerBound;
		lowerBound = newLowerBound;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, AcmeadmanagementPackage.PMULTIPLICITY__LOWER_BOUND, oldLowerBound, lowerBound));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getUpperBound() {
		return upperBound;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setUpperBound(int newUpperBound) {
		int oldUpperBound = upperBound;
		upperBound = newUpperBound;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, AcmeadmanagementPackage.PMULTIPLICITY__UPPER_BOUND, oldUpperBound, upperBound));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isHorizontal() {
		return horizontal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setHorizontal(boolean newHorizontal) {
		boolean oldHorizontal = horizontal;
		horizontal = newHorizontal;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, AcmeadmanagementPackage.PMULTIPLICITY__HORIZONTAL, oldHorizontal, horizontal));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isVertical() {
		return vertical;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setVertical(boolean newVertical) {
		boolean oldVertical = vertical;
		vertical = newVertical;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, AcmeadmanagementPackage.PMULTIPLICITY__VERTICAL, oldVertical, vertical));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case AcmeadmanagementPackage.PMULTIPLICITY__LOWER_BOUND:
				return new Integer(getLowerBound());
			case AcmeadmanagementPackage.PMULTIPLICITY__UPPER_BOUND:
				return new Integer(getUpperBound());
			case AcmeadmanagementPackage.PMULTIPLICITY__HORIZONTAL:
				return isHorizontal() ? Boolean.TRUE : Boolean.FALSE;
			case AcmeadmanagementPackage.PMULTIPLICITY__VERTICAL:
				return isVertical() ? Boolean.TRUE : Boolean.FALSE;
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case AcmeadmanagementPackage.PMULTIPLICITY__LOWER_BOUND:
				setLowerBound(((Integer)newValue).intValue());
				return;
			case AcmeadmanagementPackage.PMULTIPLICITY__UPPER_BOUND:
				setUpperBound(((Integer)newValue).intValue());
				return;
			case AcmeadmanagementPackage.PMULTIPLICITY__HORIZONTAL:
				setHorizontal(((Boolean)newValue).booleanValue());
				return;
			case AcmeadmanagementPackage.PMULTIPLICITY__VERTICAL:
				setVertical(((Boolean)newValue).booleanValue());
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case AcmeadmanagementPackage.PMULTIPLICITY__LOWER_BOUND:
				setLowerBound(LOWER_BOUND_EDEFAULT);
				return;
			case AcmeadmanagementPackage.PMULTIPLICITY__UPPER_BOUND:
				setUpperBound(UPPER_BOUND_EDEFAULT);
				return;
			case AcmeadmanagementPackage.PMULTIPLICITY__HORIZONTAL:
				setHorizontal(HORIZONTAL_EDEFAULT);
				return;
			case AcmeadmanagementPackage.PMULTIPLICITY__VERTICAL:
				setVertical(VERTICAL_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case AcmeadmanagementPackage.PMULTIPLICITY__LOWER_BOUND:
				return lowerBound != LOWER_BOUND_EDEFAULT;
			case AcmeadmanagementPackage.PMULTIPLICITY__UPPER_BOUND:
				return upperBound != UPPER_BOUND_EDEFAULT;
			case AcmeadmanagementPackage.PMULTIPLICITY__HORIZONTAL:
				return horizontal != HORIZONTAL_EDEFAULT;
			case AcmeadmanagementPackage.PMULTIPLICITY__VERTICAL:
				return vertical != VERTICAL_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (lowerBound: ");
		result.append(lowerBound);
		result.append(", upperBound: ");
		result.append(upperBound);
		result.append(", horizontal: ");
		result.append(horizontal);
		result.append(", vertical: ");
		result.append(vertical);
		result.append(')');
		return result.toString();
	}

} //PMultiplicityImpl
